
Partial Class AJAX_PopupMessage
    Inherits System.Web.UI.UserControl

    Public Property DisplayText() As String
        Get
            Return ErrorDisplayLabel.Text
        End Get
        Set(ByVal value As String)
            ErrorDisplayLabel.Text = value
        End Set
    End Property

    Public Sub ShowSuccessMessage(ByVal message As String)
        Me.ErrorListGridView.Visible = False
        Me.ErrorDisplayLabel.Text = message
        Me.ModalPopupErrorList.Show()
    End Sub
    Public Sub ShowErrorMessage(ByVal displayLabel As String, ByVal msg As String)
        Dim al As New ArrayList()
        al.Add(New ErrorDisplay(msg))
        ErrorDisplayLabel.Text = displayLabel
        ErrorListGridView.DataSource = al
        ErrorListGridView.DataBind()
        ErrorListGridView.Visible = True
        ModalPopupErrorList.Show()
    End Sub

    Public Sub ShowErrorList(ByVal displayLabel As String, ByVal errorList As ArrayList)
        Dim al As New ArrayList()
        For i As Integer = 0 To errorList.Count - 1
            al.Add(New ErrorDisplay(errorList(i).ToString()))
            ErrorDisplayLabel.Text = displayLabel
            ErrorListGridView.DataSource = al
            ErrorListGridView.DataBind()
            ErrorListGridView.Visible = True
            ModalPopupErrorList.Show()

        Next
    End Sub
        
        
End Class

Public Class ErrorDisplay
    Dim descriptionValue As String

    Public Property Description() As String
        Get
            Return descriptionValue
        End Get
        Set(ByVal value As String)
            descriptionValue = value
        End Set
    End Property

    Public Sub New(ByVal msg As String)
        descriptionValue = msg
    End Sub
End Class
